<%@  enablesessionstate="False" %>
<%
    ' **************************************************************************
    ' ct_logon.asp
    '
    ' Copyright (c) 2001,2004 RSA Security, Inc.
    ' All rights reserved.
    ' **************************************************************************

    ' If CTAuthMode isn't defined, the default is 'BASIC'.
    ' CTAuthMode should be one of the following:
    ' - BASIC
    ' - NT
    ' - SECURID
    ' - CUSTOM
    CTAuthMode = Request.QueryString ( "CTAuthMode" )
    if CTAuthMode = "" then
        CTAuthMode = "BASIC"
    else
        CTAuthMode = UCase( Server.HTMLEncode ( CTAuthMode ) )
    end if
    
    CTOrigUrl = Request.QueryString ( "CT_ORIG_URL" )
    CTOrigUrl = Server.HTMLEncode ( CTOrigUrl )
    
    ' Should old URI retention cookies be ignored?  The default
    ' is not to ignore, unless explicitly overriden by setting 
    ' "override_uri_retention=true" in the query string of the 
    ' URL to this page, e.g.:
    '  http://server.domain.com/cleartrust/ct_logon.asp?override_uri_retention=true
    '
    CTOverrideURIRetention = Request.QueryString( "override_uri_retention" )
    if CTOverrideURIRetention = "" then
        CTOverrideURIRetention = "false"
    else
        CTOverrideURIRetention = Server.HTMLEncode ( CTOverrideURIRetention )
    end if

    ' Find the post back URL, which is same as this URL
    PostBackURL = Request.ServerVariables ( "url" )
      
    ' Process logon if the request method is "POST". The post information is
    ' copied to the "ct-iis-form-query" header and passed back to the server.
    ' The presence of this header indicates that this request is a 
    ' authentication request.

    ' ct-iis-form-query header is recognized by the Agent and, combined with 
    ' the redirect, serves to log the user into ClearTrust. This is done in 
    ' order to work around some IIS issues.
    
    If Request.ServerVariables ( "REQUEST_METHOD" ) = "POST" Then

        ' Retrieve the form fields
        CTUser = Request.Form ( "user" )
        CTPassword = Request.Form ( "password" )
        CTAuthMode = Request.Form ( "auth_mode" )
        CTOrigUrl = Request.Form ( "orig_url" )
        CTOverrideURIRetention = Request.Form( "override_uri_retention" )
	     CTBusinessUser = Request.Form( "businessUser")
        if not ( CTUser = "") Then
            CTUser = Server.URLEncode (CTUser)
        end if
        if not ( CTPassword = "" ) Then
            CTPassword = Server.URLEncode (CTPassword)
        end if

        ' Create a query string
        QueryString = "user=" & CTUser & _
                      "&password=" & CTPassword & _
                      "&auth_mode=" & CTAuthMode & _
                      "&orig_url=" & CTOrigUrl & _
                      "&override_uri_retention=" & CTOverrideURIRetention

        ' Add the new header, that indicates "authentication request"
        Response.AddHeader "ct-iis-form-query", QueryString
       
        Response.Cookies("businessUser") = CTBusinessUser 
        Response.Cookies("sys") = Request.Form("sysadmin")

      
        
        ' Issue redirect
        Response.Redirect "/login/ct_logon.asp"
        
    End If    
   

%>
<%
        
 LoginUrlPage = Request.QueryString("sys")


 %>
  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <!-- #include file="connection.asp" -->
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Insight - login </title>
    <link href="Insight21.css" type="text/css" rel="stylesheet" />
    <style type="text/css">
    <!--
    BODY { margin: 15px; background-color: #FFFFFF; font-family: tahoma, verdana, geneva, arial, lucida, sans-serif; font-size: 11px; color: #000000}
    TABLE,TH,P, BLOCKQUOTE, UL, LI, INPUT, SELECT, TEXTAREA {font-family: tahoma, verdana, geneva, arial, lucida, sans-serif; font-size: 11px; color: #000000}
    .body_sm { font-family: tahoma, verdana, geneva, arial, lucida, sans-serif; font-size: 10px; color: #4C4949}
    .rule { background-color: #6699CC}
    .rule2 { background-color: #4C4949}
    .pg_hdr { font-family: tahoma, verdana, geneva, arial, lucida, sans-serif;     font-size: 24px; color: #000000}
    .pg_body { background-color: #FFFFEE}
    .hdline { font-family: tahoma, verdana, geneva, arial, lucida, sans-serif; font-size: 12px; color: #3A6688; font-weight: bold}
    .hdline_error { font-family: tahoma, verdana, geneva, arial, lucida, sans-serif; font-size: 12px; color: #FF0000; font-weight: bold}
    .prmt { font-family: tahoma, verdana, geneva, arial, lucida, sans-serif; font-size: 11px; color: #4C4949; font-weight: bold}
    A:link, A:active, A:visited { font-family: tahoma, verdana, geneva, arial, lucida, sans-serif; font-size: 11px; color: #6699CC; text-decoration: none;} 
    A:hover { font-family: tahoma, verdana, geneva, arial, lucida, sans-serif;     font-size: 11px; color: #333333}
    -->
    
   
    </style>
</head>
<body onload="authForm.user.focus( )">
    <%
    ' When defining logon forms specify "CTAuthMode=<auth_type>"
    ' and "CTLoginErrorMsg=<This is my error message>" as part of the query 
    ' string.  If you want to ignore old uri retention cookies then also
    ' specify "override_uri_retention=true" in the query string.
    '
    ' Example:
    ' cleartrust.agent.login_error_user_location_basic=
    ' /cleartrust/ct_logon.asp?CTAuthMode=BASIC&CTLoginErrorMsg=Invalid%20User
    CTLoginErrorMsg = Server.HTMLEncode( Request.QueryString ( "CTLoginErrorMsg" ) )
    ' if len ( CTLoginErrorMsg ) > 0 then
    '    Response.Write ( "<BR><FONT SIZE=" & chr(34) & "+1" & chr(34) & _
    '                     " FACE=" & chr(34) & "Helvetica" & chr(34) & _
    '                    " COLOR=" & chr(34) & "#375392" & chr(34) & ">" )
    '   Response.Write ( CTLoginErrorMsg & "</FONT>" )
    'end if
    %>
    <form name="authForm" action="<%=PostBackURL %>" method="POST" accept-charset="UTF-8">
        <input type="hidden" name="auth_mode" value="<%=CTAuthMode%>">
        <input type="hidden" name="orig_url" value="<%=CTOrigUrl%>">
        <input type="hidden" name="override_uri_retention" value="<%=CTOverrideURIRetention%>">
               <input type="hidden" name="sysadmin" value="<%=LoginUrlPage%>">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td>
                    <table class="Header" width="100%" border="0">
                        <tr>
                            <td style="width: 173px; height: 52px">
                                <img alt="" src="Images/insight_logo.gif" /></td>
                            <td align="left" style="height: 52px">
                                <table class="HeaderBannerLink" border="0">
                                    <tr class="HeaderWelcomeBanner">
                                        <td>
                                            &nbsp;</td>
                                    </tr>
                                    <tr class="HeaderModuleNavigation">
                                        <td class="HeaderModuleNavigationImageCell" style="height: 24px">
                                            <img alt="" src="Images/Row1_Start.gif" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <table class="SubModuleSummaryNavigation">
                        <tr>
                            <td class="SubModuleSummaryNavigationFillerCell">
                                &nbsp;</td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <table class="Login" cellspacing="15" cellpadding="15" width="100%">
                        <tr>
                            <td>
                                <table cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td class="LeftPane">
                                            <table cellspacing="5">
                                                <tr>
                                                    <td valign="top" class="Login">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                                                            <tr>
                                                                <td colspan="2" class="label">
                                                                    <%If CTAuthMode = "SECURID" Then%>
                                                                    This resource requires an RSA SecurID log in. Please login by entering your user
                                                                    ID and your PASSCODE.
                                                                    <% Else %>
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td class="OrangeLabel">
                                                                                Welcome to Insight.</td>
                                                                        </tr>
                                                                        <tr>
                                                                        </tr>
                                                                    <td class="label">
                                                                        Please Login below.</td>
                                                            </tr>
                                                        </table>
                                                        <%End If%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;</td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <%if SiteStatus <> "SiteDown" or LCase(LoginUrlPage) = "sysadmin" then %>
                                                <tr>
                                                    <td colspan="2" class="label">
                                                        Partners UserName:</td>
                                                </tr>
                                                <tr>
                                                    <td width="100%" colspan="2">
                                                        <input type="text" id="user" name="user" size="30"></td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;</td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <%If CTAuthMode = "SECURID" Then%>
                                                <tr>
                                                    <td class="prmt" nowrap>
                                                        PASSCODE:</td>
                                                    <td width="100%">
                                                        <input type="password" name="password" size="30"></td>
                                                </tr>
                                                <% Else %>
                                                <tr>
                                                    <td colspan="2" class="label">
                                                        Partners Password:</td>
                                                </tr>
                                                <tr>
                                                    <td width="100%" colspan="2">
                                                        <input type="password" name="password" size="30"></td>
                                                </tr>
                                                <%End If %>
                                                <tr>
                                                    <td>
                                                        &nbsp;</td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                   <%if LCase(LoginUrlPage) = "sysadmin" then %>
                                                <tr>
                                                    <td colspan="2" class="label">
                                                        BusinessUser:</td>
                                                </tr>
                                                <tr>
                                                    <td width="100%" colspan="2">
                                                        <input type="text" name="businessUser" size="30"></td>
                                                </tr>
                                                <%End If %>
                                                 <tr>
                                                    <td>
                                                        &nbsp;</td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td nowrap valign="top" height="22">
                                                        &nbsp;</td>
                                                    <td width="100%" valign="top" height="22">
                                                        <input type="image" src="images/b_login.gif">
                                                    </td>
                                                </tr>
                                                <tr>                                                    
                                                    <td width="100%" valign="top" height="22" colspan=2 align=left>
                                                        <img src="images/login_arrow.gif" alt="Arrow" />&nbsp; <a href='https://myprofile.partners.org/' target=_blank>Forgot UserName or Password?</a>
                                                    </td>
                                                </tr>
                                                <%End If %>
                                                <%    if len ( CTLoginErrorMsg ) > 0 then %>
                                                <tr>
                                                    <td colspan="2" class="hdline_error">
                                                        <%=CTLoginErrorMsg%>
                                                    </td>
                                                </tr>
                                                <%  end if %>
                                            </table>
                                        </td>
                                    </tr>
                                    <!--Here put the login controls-->
                                    <tr>
                                        <td>
                                            <hr />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="images/login_arrow.gif" alt="Arrow" />&nbsp; <a href="http://phsresearchintranet.partners.org/phs_researchappgroup/helpdesk/userRegistrationRequest_INsight.asp" target=_blank>
                                                <span style="white-space: nowrap">Request Insight Access</span> </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="images/login_arrow.gif" alt="Arrow" />&nbsp; <a href="mailto:insightHelpDesk@partners.org?subject=Request Insight Help">
                                                <span style="white-space: nowrap">Request Insight Help</span> </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="images/login_arrow.gif" alt="Arrow" />&nbsp; <a href="mailto:insightHelpDesk@partners.org?subject=Request Insight Training">
                                                <span style="white-space: nowrap">Request Insight Training</span> </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="images/login_arrow.gif" alt="Arrow" />&nbsp; <a href="http://phsresearchintranet.partners.org/PHS_ResearchAppGroup/PHS_ResearchAppGroup_HomePage.asp?subID=leftnav1">
                                                <span style="white-space: nowrap">PHS Research Applications Group</span> </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="images/login_arrow.gif" alt="Arrow" />&nbsp; <a href="http://stage-insightAccess.partners.org/"
                                                target="_blank" id="lnkPtAccess" runat="server"><span style="white-space: nowrap">Request
                                                    Access To Patient Care Expense Details</span> </a>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td class="RightPane">
                                <table cellspacing="15" cellpadding="15">
                                    <tr>
                                        <td>
                                            <table>
                                                <%if SiteStatus= "SiteDown" or SiteStatus= "Informational" then%>
                                                <tr>
                                                    <td valign="top" class="HeaderLabelError" width="624px" height="7px">
                                                        <%=SiteMessage %>
                                                        <br />
                                                        <br />
                                                    </td>
                                                </tr>
                                                <%End If %>
                                                <tr>
                                                    <td class="HeaderLabel">
                                                        <span style="white-space: nowrap">Insight with eIRB and eIACUC Submission</span>
                                                        <br />
                                                        <span style="white-space: nowrap">Partners Electronic Research Administration Portal</span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;</td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Insight Research Portal is a web-based application with over 9000 current users
                                                        developed for the entire research community (including investigators, departmental
                                                        research managers, unit chiefs, and administrators) to review, monitor and manage
                                                        the research portfolio. It was originally designed by a collection of working groups
                                                        consisting of departmental administration (Radiology, Surgery, Medicine, etc.),
                                                        central research management operations (Grants and Contracts, Research Finance,
                                                        IRB, etc.), lab managers as well as investigators.
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;</td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        It has eliminated the need for double entry of data into multiple systems. Information
                                                        now flows seamlessly into Insight each night. It has allowed departments to discontinue
                                                        investment in costly 'shadow systems' and has empowered researchers and their staff
                                                        to understand where they stand in their research program 24 hours a day, 7 days
                                                        a week. It has also alleviated the need for central administration supporting these
                                                        departments to answer routine calls and focus on the ever-growing complexities relating
                                                        to compliance and research oversight activities.
                                                    </td>
                                                </tr>
                                                <tr ><td class="HeaderLabel">&nbsp;</td></tr>
                                                <tr ><td class="HeaderLabel">System Information</td></tr>
                                                <tr><td>                                                
                                                    Insight is supported on machines with the following configurations:
                                                    <ol>
                                                    <li><b>MAC:</b> Operating System: OS X; Web Browsers: Safari and Firefox</li>
                                                    <li><b>PC:</b>  Operating System: Win 2K/XP;  Web Browsers: Internet Explorer 6/7  </li>
                                                    </ol>
                                                </td>
                                                </tr>
                                                <tr><td>&nbsp;</td></tr>
                                                <tr><td><font color="red">Please note that the Insight system is unavailable between the hours of 12 AM- 3 AM due to scheduled data updates. </font></td></tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        
    </form>
</body>
</html>
